package cz.muni.fi.hauntedhouses.to;

import cz.muni.fi.hauntedhouses.type.Cas;
import cz.muni.fi.hauntedhouses.type.CasAdapter;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

/**
 *
 * @author Andrea Vasekova, 325181
 */
@XmlRootElement
public class GhostTO {
    
    private Long id;
    private String name;
    private Cas hauntingFrom;
    private Cas hauntingTo;
    private String description;
    private float power;
    private SkillTO skill;
    private HouseTO house;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @XmlJavaTypeAdapter(CasAdapter.class)
    public Cas getHauntingFrom() {
        return hauntingFrom;
    }

    public void setHauntingFrom(Cas hauntingFrom) {
        this.hauntingFrom = hauntingFrom;
    }

    @XmlJavaTypeAdapter(CasAdapter.class)
    public Cas getHauntingTo() {
        return hauntingTo;
    }

    public void setHauntingTo(Cas hauntingTo) {
        this.hauntingTo = hauntingTo;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public float getPower() {
        return power;
    }

    public void setPower(float power) {
        this.power = power;
    }

    public SkillTO getSkill() {
        return skill;
    }

    public void setSkill(SkillTO skill) {
        this.skill = skill;
    }
    
    public HouseTO getHouse() {
        return house;
    }

    public void setHouse(HouseTO house) {
        this.house = house;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof GhostTO)) {
            return false;
        }
        GhostTO other = (GhostTO) object;
        
        if (this.id == null || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        
        return true;
    }
    
    @Override
    public String toString() {
        return "Ghost[Name: "+this.getName()+" "+"Haunting from: "
                + this.getHauntingFrom()+" "+"Haunting to: "
                + this.getHauntingTo()+"]";
    }
}
